<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
	</head>
	<body>
		<div id="app">
			<!-- <nav></nav> -->
			<h3>{{name}}</h3>
			<h3>{{count}}</h3>
			<button v-on:click="jia">++</button>
			<!-- <footer></footer> -->
			<button-counter></button-counter>
			<button-counter></button-counter>
		</div>
		<template id="t1">
			<button v-on:click="count++">You clicked me {{ count }} times.</button>
		</template>
		<script type="text/javascript">
			new Vue({
				el: '#app',
				data: {
					name: '张三',
					count: 0
				},
				methods: {
					jia() {
						this.count++;
					}
				},
				components: {
					'button-counter': {
						// template: '<button v-on:click="count++">You clicked me {{ count }} times.</button>',
						template: '#t1',
						data() {
							return {
								count: 0
							}
						}
					}
				}
			})
		</script>
	</body>
</html>
